Skip to content

fix: correct Feishu OAuth authentication and web download#181

Open
coffeeeeffoc wants to merge 10 commits intoWsine:mainfrom
coffeeeeffoc:feat/user-login
Open

fix: correct Feishu OAuth authentication and web download#181
coffeeeeffoc wants to merge 10 commits intoWsine:mainfrom
coffeeeeffoc:feat/user-login

Conversation

@coffeeeeffoc
Copy link
Copy Markdown

Summary

  • Fix OAuth token request: use app_id in body, client_secret via HTTP Basic Auth per Feishu API
  • Fix scope from drive:file:readonly to drive:drive:readonly for wiki download access
  • Fix web download handler to read user token from config file instead of env vars
  • Fix browser auto-launch using exec.Command instead of os.StartProcess

Test plan

  • Run feishu2md login - browser should auto-open OAuth page
  • Complete OAuth flow - token should be saved successfully
  • Download wiki document - should work with user identity

🤖 Generated with Claude Code

coffeeeeffoc and others added 10 commits March 26, 2026 02:54
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add io.LimitReader (10MB limit) to prevent memory exhaustion
- Use package-level defaultClient instead of per-request clients
- Add input validation for code and refreshToken parameters
- Add tests for ExchangeCodeForToken and RefreshUserToken

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The lark SDK's WithUserAccessToken is a method-level option, not
client-level. This change updates all API methods that need user
identity to pass the stored userAccessToken as a method option.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix OAuth token request: use app_id in body, client_secret via HTTP Basic Auth
- Fix scope from drive:file:readonly to drive:drive:readonly for wiki access
- Fix web download handler to use user token from config file
- Use exec.Command instead of os.StartProcess for browser launch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant